[#escape x as x?html]
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>增值服务编辑</title>
[#include "/include/jsvalidation.ftl"]
[#include "/include/main.ftl"]
[#include "/include/popdialog.ftl"]
    <script>
        $(function() {
            $("#ValueaddEdit").tabs();
        });
		function selectUser() {
            popDialog("selectUser", "选择客户",
                    "/Ins/customer/select",
                    rp, 600, 600);
        }
		
		var rp = function refreshPage(data) {
            if (data != null) {
                $('#custSn').val(data.sn);
                $('#name').html(data.name);
                $('#custType').val(data.custType);
                $('#custTypeName').html(data.custTypeName);
                $('#IDCard').html(data.IDCard);
                $('#IDAddress').html(data.IDAddress);
                $('#compAddress').html(data.compAddress);
                $('#custLink').attr("href", "/Ins/customer/edit/" + data.sn);
            }
        };
		
		function getCompany(){
			$.get('/Ins/Customer/getListByType/' + sn, null,
            function(data){
				/*
                var tbodyCar = "";
                $.each(data, function(i, val){
                    tbodyCar += "<tr>"+
                                "<td><input type=\"radio\" name=\"custCarSn\" id=\"custCarSn_" + val.sn +"\" value=\"" + val.sn +"\">"+
                                    val.carNo + "</td>"+
                                "<td>"+ val.carKind +"</td>"+
                                "<td>"+ val.brand +"</td>"+
                                "<td>"+val.regDate+"</td>"+
                            "</tr>" ;
                });
                $('#cars').html(tbodyCar);*/
            },"json")
		}

    </script>
</head>
<body>
<div class="ui-widget page">
[#include '/top.ftl']

    <div class="content">
    [#include '/leftNav.ftl']
        <div style="width:845px;height:600px;float: left;padding-left: 5px">
            <div class="ui-widget-content ui-corner-all" style="min-height: 600px;">
                <form name="mainForm" id="mainForm" method="post" action="/Ins/valueadd/save" onsubmit="if (va.validate()) formSubmit(this);else return false;">
<INPUT TYPE="hidden" NAME="sn" VALUE="${obj.ValueaddObj.sn?default('')}">
                <INPUT TYPE="hidden" NAME="custSn" id="custSn" VALUE="${obj.ValueaddObj.custSn?default('')}">
                    【<a href="/Ins/valueadd/list">返回增值服务列表</a>】
                    
                    <div id="ValueaddEdit" style="width:830px">

                        <ul style="border-bottom:#aed0ea 1px solid;">
                            <li><a href="Valueadd_base">基本资料</a></li>

                        </ul>
                        <div id="Valueadd_base">
<p>【<a href="javaScript:selectUser();">选择客户</a>】
                        </p>
                      <p>【客户资料】</p>
                        <table width="100%" border="0" cellspacing="4">
                            <tr>
                                <td width="17%" bgcolor="#CCCCCC"><p>客户名称 </p></td>
                              <td><span id="name">${(obj.CustomerObj.name)!''}</span></td>
                            </tr>
                            <tr>
                                <td bgcolor="#CCCCCC"><p>身份证号 </p></td>
                              <td> <span id="IDCard">${(obj.CustomerObj.IDCard)!''}</span> </td>
                            </tr>
                            <tr class="trBackWhite">
                                <td bgcolor="#CCCCCC"><p>身份证地址 </p></td>
                              <td><span id="IDAddress">${(obj.CustomerObj.IDAddress)!''}</span></td>
                            </tr>
                            <tr class="trBackWhite">
                                <td bgcolor="#CCCCCC">单位地址</td>
                              <td> <span id="compAddress">${(obj.CustomerObj.compAddress)!''}</span></td>
                            </tr>
                        </table>
                        </div>
<p>
增值服务类型<select name="vadSn" id="vadSn" onChange="getCompany();">
[#list obj.ValueaddDefList as vad]
<option value="${vad.sn}">${vad.addType}-${vad.addSubType}-${vad.name}</option>
[/#list]
</select>

<script>$("#vadSn").val("${(obj.ValueaddObj.vadSn)?default('')}");</script>
 </p>
<p>
增值服务商<select name="vaCompanySn" id="vaCompanySn" >
[#list obj.CustomerList as c]
<option value="${c.sn}">${c.name}</option>
[/#list]
</select>
<script>$("#vaCompanySn").val("${(obj.ValueaddObj.vaCompanySn)?default('')}");</script>
 </p>
<p>
有效期  <input type="text"  size="20" id="validate" name="validate" class="validate-date-yyyy-MM-dd" onClick="popCalendar(this)" >

<script>$("#validate").val("${(obj.ValueaddObj.validate?string('yyyy-MM-dd'))?default('')}");</script>
 </p>
<p>
流水号  <input type="text"  size="20" id="vaNo" name="vaNo" class="max-length-40 " readonly>

<script>$("#vaNo").val("${(obj.ValueaddObj.vaNo)?default('')}");</script>
 </p>
<p>
是否已用<select name="isUsed" id="isUsed" >
  <option value="0" selected>否</option>
  <option value="1">是</option>
</select>

<script>$("#isUsed").val("${(obj.ValueaddObj.isUsed)?default('')}");</script>
 </p>
<p>
使用日期  <input type="text"  size="20" id="useDate" name="useDate" class="validate-date-yyyy-MM-dd" onClick="popCalendar(this)" >

<script>$("#useDate").val("${(obj.ValueaddObj.useDate?string('yyyy-MM-dd'))?default('')}");</script>
 </p>
<p>
                          <input name="submit" type="submit" value="保存" onClick="">
                        | <a href="/Ins/valueadd/del/${obj.ValueaddObj.sn?default('')}" onClick="return confirm('确定删除?')">删除</a></p>

                        </div>

                </form>
                <script>
                  va = new Validation('mainForm');
                </script>
            </div>

        </div>
    </div>

[#include '/bottom.ftl']
</div>
</body>
</html>
[/#escape]
